package xzit.gcxy.xxhzx.zhh.entity;

import java.util.ArrayList;
import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * 
 * @desc 角色表
 *
 * @author zhh
 */
@Entity
@Table(name="z_app_navigator")
public class APPNavigatorVO extends BaseVO {
	/**
	 * 应用名称
	 */
	@Column(nullable = false, length = 20)
	private String appname;
	
	/**
	 * 应用导航地址
	 */
	@Column(nullable = false, length = 50)
	private String appurl;
	
	/**
	 * 应用描述
	 */
	@Column(length = 100)
	private String appdesc;
	
	/**
	 * 上级部门
	 */
	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "parentid")
	private APPNavigatorVO parentApp;
	
	/**
	 * 下属部门;
	 */
	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "parentApp")
	private List<APPNavigatorVO> apps = new ArrayList<APPNavigatorVO>();

	/**
	 * 应用名称
	 */
	@Column(nullable = false, length = 20)
	private int level;
	
	public String getAppname() {
		return appname;
	}

	public void setAppname(String appname) {
		this.appname = appname;
	}

	public String getAppurl() {
		return appurl;
	}

	public void setAppurl(String appurl) {
		this.appurl = appurl;
	}

	public String getAppdesc() {
		return appdesc;
	}

	public void setAppdesc(String appdesc) {
		this.appdesc = appdesc;
	}

	public APPNavigatorVO getParentApp() {
		return parentApp;
	}

	public void setParentApp(APPNavigatorVO parentApp) {
		this.parentApp = parentApp;
	}

	public List<APPNavigatorVO> getApps() {
		return apps;
	}

	public void setApps(List<APPNavigatorVO> apps) {
		this.apps = apps;
	}

	public int getLevel() {
		return level;
	}

	public void setLevel(int level) {
		this.level = level;
	}
	
}
